//
//  FMPickerConfigure.m
//  FMFormSubmitKit_Example
//
//  Created by 郑桂华 on 2020/6/30.
//  Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//

#import "FMPickerConfigure.h"

@implementation FMPickerConfigure

- (id)copyWithZone:(NSZone *)zone{
    FMPickerConfigure *con = [[self class] allocWithZone:zone];
    
    con.bottomHeight = self.bottomHeight;
    con.topHeight = self.topHeight;
    con.pickerHeight = self.pickerHeight;
    con.bgBlackAlpha = self.bgBlackAlpha;
    con.sureBtnWidth = self.sureBtnWidth;
    con.closeBtnWidth = self.closeBtnWidth;
    con.hiddenRemovePicker = self.hiddenRemovePicker;
    con.pickerDataRowHeight = self.pickerDataRowHeight;
    con.backgroundColor = self.backgroundColor;
    
    con.titleFont = self.titleFont;
    con.titleColor = self.titleColor;
    
    con.textColor = self.textColor;
    
    if (@available(iOS 13.4, *)) {
        con.datePickerStyle = self.datePickerStyle;
    }
    
    con.layoutCustom = [self.layoutCustom copy];
    con.configurePicker = [self.configurePicker copy];
    
    return con;
}

+ (instancetype)shareConfigure{
    static FMPickerConfigure *_configure;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        FMPickerConfigure *con = [[self alloc] init];
        con.bottomHeight = 49;
        con.topHeight = 40;
        con.pickerHeight = 300;
        con.bgBlackAlpha = 0.7;
        con.sureBtnWidth = 60;
        con.closeBtnWidth = 60;
        con.hiddenRemovePicker = YES;
        con.pickerDataRowHeight = 40;
        con.backgroundColor = [UIColor whiteColor];
        
        con.titleFont = [UIFont systemFontOfSize:15 weight:UIFontWeightBold];
        con.titleColor = [UIColor blackColor];
        
        con.textColor = [UIColor blackColor];
        
        if (@available(iOS 13.4, *)) {
            con.datePickerStyle = UIDatePickerStyleWheels;
        }
        
        _configure = con;
    });
    return _configure;
}

@end
